package com.health.circle.ui;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.health.circle.R;
import com.health.circle.base.BaseActivity;

public class FourTabActivity extends BaseActivity implements OnClickListener {

	private Button mBtnQuit;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.four_tab_activity);

		initView();
	}

	private void initView() {

		mBtnQuit = (Button) findViewById(R.id.btn_quit);
		mBtnQuit.setOnClickListener(this);
	}

	private void quitSystem() {
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		builder.setMessage("确定退出？");
		builder.setCancelable(false);
		builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				defaultFinish();
			}
		});
		builder.setNegativeButton("取消", new DialogInterface.OnClickListener() {
			public void onClick(DialogInterface dialog, int id) {
				dialog.cancel();
			}
		});
		AlertDialog alert = builder.create();
		alert.show();
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {

		case R.id.btn_quit:
			quitSystem();
			break;

		default:
			break;
		}

	}

}
